# -*- coding: utf-8 -*-
# @Author: Lp
# @File: exceptions.py

import time

class ElementPlaceException(Exception):
    """元素定位失败专用异常"""
    def __init__(self, message):
        super().__init__(message)
        self.timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
        self.screenshot_path = None  # 用于存储截图路径

class ElementClickException(Exception):
    """元素点击操作失败专用异常"""
    def __init__(self, message):
        super().__init__(message)
        self.timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
        self.screenshot_path = None  # 用于存储截图路径

class ElementInputException(Exception):
    """元素输入操作失败专用异常"""
    def __init__(self, message):
        super().__init__(message)
        self.timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
        self.screenshot_path = None

class ElementSwipeException(Exception):
    """滑动操作失败专用异常"""
    def __init__(self, message):
        super().__init__(message)
        self.timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
        self.screenshot_path = None

class ElementKeyboardException(Exception):
    """键盘操作失败专用异常"""
    def __init__(self, message):
        super().__init__(message)
        self.timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
        self.screenshot_path = None

class ElementAssertionException(Exception):
    """元素断言操作失败专用异常"""
    def __init__(self, message):
        super().__init__(message)
        self.timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
        self.screenshot_path = None  # 用于存储截图路径

